#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

namespace Ui {
class MainWindow;
}

class QTcpSocket;
class QTcpServer;

class MainWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    enum ScreenOrientation {
        ScreenOrientationLockPortrait,
        ScreenOrientationLockLandscape,
        ScreenOrientationAuto
    };

    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

    // Note that this will only have an effect on Symbian and Fremantle.
    void setOrientation(ScreenOrientation orientation);

    void showExpanded();

private slots:
    void on_pushButtonConnect_clicked();
    void connectionFromClient();
    void dataFromClient();
    void dataFromServer();
    void connectionToServerFailed();
    void connectionToServerSucceeded();

private:
    QByteArray buffer;
    QTcpServer *server;
    QTcpSocket *socketToServer;
    QTcpSocket *socketFromClient;
    Ui::MainWindow *ui;
};

#endif // MAINWINDOW_H
